<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" style="font-size: 47.3125px;"><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<!-- Mobile Devices Support @begin -->
<meta content="application/xhtml+xml;charset=UTF-8" http-equiv="Content-Type">
<meta content="no-cache,must-revalidate" http-equiv="Cache-Control">
<meta content="no-cache" http-equiv="pragma">
<meta content="0" http-equiv="expires">
<meta content="telephone=no, address=no" name="format-detection">
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes"> <!-- apple devices fullscreen -->
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent">
<!-- Mobile Devices Support @end -->
<!--<meta name="apple-mobile-web-app-capable" content="yes" /> 
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> -->
<title>weixin://private/setresult/SCENE_FETCHQUEUE&amp;eyJmdW5jIjoicHJlVmVyaWZ5SlNBUEkiLCJwYXJhbXMiOnsidmVyaWZ5SnNBcGlMaXN0IjpbImNoZWNrSnNBcGkiLCJtZW51OnNoYXJlOnRpbWVsaW5lIiwibWVudTpzaGFyZTphcHBtZXNzYWdlIiwibWVudTpzaGFyZTpxcSIsIm1lbnU6c2hhcmU6d2VpYm9BcHAiLCJoaWRlTWVudUl0ZW1zIiwic2hvd01lbnVJdGVtcyIsImhpZGVBbGxOb25CYXNlTWVudUl0ZW0iLCJzaG93QWxsTm9uQmFzZU1lbnVJdGVtIiwidHJhbnNsYXRlVm9pY2UiLCJzdGFydFJlY29yZCIsInN0b3BSZWNvcmQiLCJvblJlY29yZEVuZCIsInBsYXlWb2ljZSIsInBhdXNlVm9pY2UiLCJzdG9wVm9pY2UiLCJ1cGxvYWRWb2ljZSIsImRvd25sb2FkVm9pY2UiLCJjaG9vc2VJbWFnZSIsImltYWdlUHJldmlldyIsInVwbG9hZEltYWdlIiwiZG93bmxvYWRJbWFnZSIsImdldE5ldHdvcmtUeXBlIiwib3BlbkxvY2F0aW9uIiwiZ2VvTG9jYXRpb24iLCJoaWRlT3B0aW9uTWVudSIsInNob3dPcHRpb25NZW51IiwiY2xvc2VXaW5kb3ciLCJzY2FuUVJDb2RlIiwiZ2V0QnJhbmRXQ1BheVJlcXVlc3QiLCJvcGVuUHJvZHVjdFZpZXdXaXRoUGlkIiwiYmF0Y2hBZGRDYXJkIiwiY2hvb3NlQ2FyZCIsImJhdGNoVmlld0NhcmQiXSwiYXBwSWQiOiJ3eDI1MzY3NDM4YzhjZTA3OTkiLCJ2ZXJpZnlBcHBJZCI6Ind4MjUzNjc0MzhjOGNlMDc5OSIsInZlcmlmeVNpZ25UeXBlIjoic2hhMSIsInZlcmlmeVRpbWVzdGFtcCI6IjE0NDczODQwNzkiLCJ2ZXJpZnlOb25jZVN0ciI6Ijc1ZjlmOGMzLTQ0NGUtNDdmNi04MzE4LTI2Yzc1MjY5NGIyMSIsInZlcmlmeVNpZ25hdHVyZSI6IjVlZjA2YjgyZDczNzk5NDc4ZmIzMjM4ZjkwNzM5NTY1YWEzNmZhODIifSwiX19tc2dfdHlwZSI6ImNhbGwiLCJfX2NhbGxiYWNrX2lkIjoiMTAwMCJ9</title>
<link href="./source/modules/laoyou_csyx/template/style/csyx.min.css" rel="stylesheet" type="text/css">
<link href="./source/modules/laoyou_csyx/template/style/base.min.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>



<script type="text/javascript">
	if( false){
		document.domain = 'faisco.cn';
		
	}
</script>
<script type="text/javascript" src="./source/modules/laoyou_csyx/template/style/jquery-core.min.js"></script>
<!--<script type="text/javascript" src="//hdg.faisys.com/js/comm/fai.min.js?v=201510121802"></script>-->

<!--<script type="text/javascript" src="//hdg.faisys.com/js/comm/jquery/jquery-ui-core.min.js?v=201510261826"></script>-->
<!--<script type="text/javascript" src="//hdg.faisys.com/js/comm/faiui.min.js?v=201503031847"></script>-->

<script type="text/javascript">
    //全局变量
    var _manage = false,
        _resRoot = '//hdg.faisys.com',
        g_test = false,
        g_showSkillSup = false, //是否开启技术支持
        g_showMenu = true,
        g_scoreFlag = 0,   
        g_drawLimitDef = 100, //游戏默认门槛
        g_style = 15,
        g_scoreUnit = '分',
        m_debug = false,                            
        g_testCMD = 'null',
        g_ajaxUrl = '//hd.faisco.cn/ajax/',
        g_startTime = '2015-11-04 17:00',
        g_failSrcId = 15,//游戏挫败量srcId
        g_setGameTimeInterval = 10,//所有游戏计时时间间隔
        g_isDoubleGame = false,//是否是双人游戏
        g_pauseMusic = false,//是否暂停音乐
        undefined;
        
    var allImage = {    //存放所有loading好的image对象,src为key
        imgPaths : [],
        complete : false,
        readyCallBack : [],
        onReady  :function(callBack){
            if(allImage.complete){
                callBack();
            }else{
                allImage.readyCallBack.push(callBack);
            }
        }
    };  
    if(g_testCMD.indexOf('dbg') !== -1){
        m_debug = true;//如果是测试状态，开启调试模式
    }
    var g_rem = 20;
    (function(){
        var h = window.screen.width - $(window).height();
        var remBase = Math.min($(window).width(),$(window).height()+h)/16;
        remBase === 0 && (remBase = '20px');
        $('html').css('font-size',remBase);
        g_rem = parseFloat(remBase);
    })();
</script>

<script type="text/javascript" src="./source/modules/laoyou_csyx/template/style/createjs.min.js"></script>
<script type="text/javascript" src="./source/modules/laoyou_csyx/template/style/hdgame.min.js"></script>
<script type="text/javascript" src="./source/modules/laoyou_csyx/template/style/hdUtil.min.js"></script>
<script type="text/javascript" src="./source/modules/laoyou_csyx/template/style/lufylegend.min.js"></script>
<script type="text/javascript" src="./source/modules/laoyou_csyx/template/style/jquery.rotate.min.js?"></script>

<script type="text/javascript">

    // createjs.Sound.on("fileload",function(event){
    //     if(!_manage && event.id === 'start'){
    //         musicList[0].optFlag != 1 && createjs.Sound.play("start");
    //     }
    // });

HdGame.gameDomain = 'hd.faisco.cn';
if(false){
	HdGame.gameDomain = 'hd.webportal.cc';
}
var Edit = null;

</script>

<script type="text/javascript">
    wx.config({
          debug: false,
          appId: 'wx25367438c8ce0799',
          timestamp: 1447384079,
          nonceStr: '75f9f8c3-444e-47f6-8318-26c752694b21',
          signature: '5ef06b82d73799478fb3238f90739565aa36fa82',
          jsApiList: [
            'checkJsApi',
            'onMenuShareTimeline',
            'onMenuShareAppMessage',
            'onMenuShareQQ',
            'onMenuShareWeibo',
            'hideMenuItems',
            'showMenuItems',
            'hideAllNonBaseMenuItem',
            'showAllNonBaseMenuItem',
            'translateVoice',
            'startRecord',
            'stopRecord',
            'onRecordEnd',
            'playVoice',
            'pauseVoice',
            'stopVoice',
            'uploadVoice',
            'downloadVoice',
            'chooseImage',
            'previewImage',
            'uploadImage',
            'downloadImage',
            'getNetworkType',
            'openLocation',
            'getLocation',
            'hideOptionMenu',
            'showOptionMenu',
            'closeWindow',
            'scanQRCode',
            'chooseWXPay',
            'openProductSpecificView',
            'addCard',
            'chooseCard',
            'openCard'
          ]
    });
    var wxConfigShareImg = '//hd.faisys.com/image/game/l_csyx.jpg?v=201508111845';
    if(!/^http:/.test(wxConfigShareImg) && /^\/\//.test(wxConfigShareImg)){
        wxConfigShareImg = 'http:' + wxConfigShareImg;
    }
    function setWxShare(desc,url,callBack){
        wx.ready(function () {
            // 1 判断当前版本是否支持指定 JS 接口，支持批量判断
            try{
                wx.onMenuShareTimeline({
                      title: desc,
                      link: url||'http://hd.faisco.cn/7167268/10/load.html?style=15',
                      imgUrl: wxConfigShareImg,
                      success: function (res) {
                        $.ajax({
                            type : 'post',
                            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setShareNum&aid=7167268&gameId=10&openId=o1ueSjigVd4EIc_IballnhNEJfj0',
                            error : function(){ 
                                if(m_debug){
                                    alert( '服务繁忙，请稍候重试' ); 
                                }  
                            },
                            success : function(data){
                                if(!m_debug){
                                    //统计分享  								
                                    HdGame.logDog(1000004,22);
                                }
                                callBack && callBack(data);
                            }
                        });     
                      },
                      cancel: function (res) {
                        //$("#sharePanel").hide();
                      }/*,
                      fail: function (res) {
                        alert(JSON.stringify(res));
                      }*/
                });
                
                wx.onMenuShareAppMessage({
                    title: '冲入榜首看一看，精美礼品马上来！', // 分享标题
                    desc: desc, // 分享描述
                    link: url||'http://hd.faisco.cn/7167268/10/load.html?style=15', // 分享链接
                    imgUrl: wxConfigShareImg, // 分享图标
                    type: 'link', // 分享类型,music、video或link，不填默认为link
                /*  dataUrl: '',*/ // 如果type是music或video，则要提供数据链接，默认为空
                    success: function () { 
                        $.ajax({
                            type : 'post',
                            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setShareNum&aid=7167268&gameId=10&openId=o1ueSjigVd4EIc_IballnhNEJfj0',
                            error : function(){ 
                                if(m_debug){
                                    alert( '服务繁忙，请稍候重试' ); 
                                }   
                            },
                            success : function(data){ 
                                if(!m_debug){
                                    //统计分享  
                                    HdGame.logDog(1000004,22);
                                }
                                callBack && callBack(data);
                            }
                        }); 
                    },
                    cancel: function () { 
                        // 用户取消分享后执行的回调函数
                        //alert("已取消");
                    }
                });
            }catch(e){
                alert(e.message);
            }
        });
    }
    var scoreUnit = '达到100分'.match(/[分秒]/);
    scoreUnit = scoreUnit ? scoreUnit[0] : '';
    function setShareText(text){
        text = text.replace(/&nbsp;/g,' ').replace(/&lt;/g, '<').replace(/&gt;/g, '>');
        return text.replace(/<span class=["']tag["'] contenteditable=["']?false["']?>(.+?)<\/span>/g,function(match,$1){
            switch($1){
                case '玩家名称':
                    return 'kylst';
                case '游戏成绩':
                    return HdGame.currentScore;
                case '游戏排名':
                    return HdGame.currentRank;
                case '奖品名称':
                    return HdGame.currentAward;
                case '奖项等级':
                    return HdGame.currentAwardStyle;
            }
        });
    }
    function setWxShareByStatus(){
        if(false){
            return;
        }
        if(typeof arguments[0] === 'string'){
            HdGame.currentShareUrl = arguments[0];
        }
        if(false){
            if(HdGame.currentShareUrl){
                setWxShare(setShareText('<span class="tag" contenteditable="false">玩家名称</span>已经在活动里赢得<span class="tag" contenteditable="false">奖品名称</span>，你也快来玩游戏赢大奖吧！'),HdGame.currentShareUrl);
            }else{
                setWxShare(setShareText('轻轻松松就能抽到大奖，积攒多年的人品终于有用了，你也赶紧来抽奖吧！！'));
            }
        }else{
            if(HdGame.currentAward){
                setWxShare(setShareText('<span class="tag" contenteditable="false">玩家名称</span>已经在活动里赢得<span class="tag" contenteditable="false">奖品名称</span>，你也快来玩游戏赢大奖吧！'));
            }else if(HdGame.currentRank){
                setWxShare(setShareText('<span class="tag" contenteditable="false">玩家名称</span>以<span class="tag" contenteditable="false">游戏成绩</span>的成绩傲视群雄，你敢来挑战Ta赢取丰厚奖品吗？'));
            }else{
                setWxShare(setShareText('轻轻松松就能抽到大奖，积攒多年的人品终于有用了，你也赶紧来抽奖吧！！'));
            }
        }
    }
    //判断该玩家是否已获取过礼物
    (function(){
        if(false){
            return;
        }
        var arr=['一','二','三','四','五','六','七','八'];
        var haveAward = false;
        if(haveAward){
            var list = [{"id":151,"aid":7167268,"code":0,"name":"kylst","awardLevel":0,"achievement":"180","gameId":10,"codeStatus":0,"info":"{\"headImg\":\"http://wx.qlogo.cn/mmopen/aD34PShiaoar94D1IjiagE76McesibrtN5MhFEJ1XnRnw3Av2ywtuJPaYia5a0lx8nmKvjyiaKGCTzwNPQSxGRUQ6rcCic1FtbwKK7/0\"}","award":"","openId":"o1ueSjigVd4EIc_IballnhNEJfj0","zlid":0,"flag":0,"openIdB":""}];            
            var itemInfo = list[list.length-1];
            if(itemInfo.award.length > 0){
                HdGame.currentAward=itemInfo.award;
            }
            var awardLevel = itemInfo.awardLevel;
            if( awardLevel != 900 && awardLevel > 0 ){  
                if(true && 9 >= awardLevel){
                    var nameList = ["一等奖","二等奖","三等奖","四等奖","五等奖","六等奖","七等奖","八等奖","安慰奖"];          
                    HdGame.currentAwardStyle = nameList[awardLevel-1];
                }else{
                    HdGame.currentAwardStyle = arr[awardLevel-1];
                }
            }else{
                HdGame.currentAwardStyle = '安慰奖';
            }    
        }
       setWxShareByStatus();
    })();

    //判断该玩家是否已有过排行榜
    (function(){
        if(false){
            return;
        }
        var params = new Array();
        params.push("gameId=",10);
        params.push("&style=",15);
        params.push("&openId=","o1ueSjigVd4EIc_IballnhNEJfj0");
        $.ajax({
            type : 'post',
            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getBestRank&aid=7167268',
            data : params.join(''),
            error : function(){},
            success : function(data){                   
                var r = $.parseJSON(data);
                HdGame.currentRank=r.rank;
                HdGame.currentScore=r.score;
                setWxShareByStatus();
            }
        });
    })();

    setWxShareByStatus();
</script>
<script type="text/javascript">
    var count = 0;
    var drawTimesLimit = 1;
    var drawScore = 30;
    var _gameOver = false; 
    var publish = true; 
	HdGame.isReg = false;
	var jumperImg = new ImageObject();
	var cloudList = [];
	var upT = 0; //上升的时间
	var jumpLimit = 0;//上升的最大高度
	var timeLimit = 0;
	var cloudTimeLimit = 0;
	var cloudTime = 0;
	var score = 0;
	var cloudDistance = 0;
	var isup = false; 
	var cloudT = 0;
	var speed = 0;
	var level = 1;
	var cloud_speed_def = 0;
	var jumper_speed_def = 0;
	var step = 0;
	var hem = 0;
	var downT = 0;
	var isCloudDown = false;
	var isStart = false;
	var fromCloud = false;
	
	var musicList = [{"path":"//hdg.faisys.com/image/csyx/bgmusic01M.mp3","fileName":"背景音乐.mp3","optFlag":1},{"path":"//hdg.faisys.com/image/csyx/jump.mp3","fileName":"跳跃音效.mp3","optFlag":0}];
    var musicListDef = [{"soundTitle":"背景音乐","fileName":"背景音乐.mp3","path":"//hdg.faisys.com/image/csyx/bgmusic01M.mp3"},{"soundTitle":"正确音效","fileName":"正确音效.mp3","path":"//hdg.faisys.com/image/csyx/jump.mp3"}];
	
	var clientWidth = $(window).width(),
		clientHeight = $(window).height(),
		htmlFontSize = parseInt($('html').css('font-size').replace('px',''));
			
    if(_manage){
        window.onload = function(){ //兼容IE10
            setTimeout(function(){
                clientWidth = $(window).width();
                clientHeight = $(window).height();
                $('#gameBgBox').css('height',clientHeight);
                $('#homeBgBox').css('height',clientHeight);
            },10);
        };
    }
    
    $(function(){ 
		canvas = document.getElementById("canvas");
        ctx = canvas.getContext("2d");

        init();
        musicList[0].optFlag != 1 && createjs.Sound.registerSound({src: musicList[0].path, id: "start"});
        musicList[1].optFlag != 1 && createjs.Sound.registerSound({src: musicList[1].path, id: "win"});

		window.addEventListener('devicemotion', deviceMotionHandler, false);  		
		window.requestAnimFrame = (function() {
			if(isIPhone4()){
				return function(callback) {
	            	window.setTimeout(callback, 40);
	        	}
			}
		return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame ||
        function(callback) {
            window.setTimeout(callback, 1000/60);
        }
    	})();
        HdGame.resulePoup.init({
            drawType  : 1,
			checkRegUrl:'//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=checkRegNum&aid=7167268&gameId=10&openId=o1ueSjigVd4EIc_IballnhNEJfj0',	
			regUrl	  : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setPlayerReg&aid=7167268&gameId=10&openId=o1ueSjigVd4EIc_IballnhNEJfj0&flag1=true',
            home      : home,
            again     : gameRestart,
            giftInit  : luckDraw
        });		

        $('#courseBg').bind('touchend',function(){
			$(this).hide();
			isStart = true;
		});	
        $('#startBtnImg').bind('touchend',function(){
            musicList[0].optFlag != 1 && !g_pauseMusic && createjs.Sound.play("start");//音效
            var status = 2;
            if(status == 1 || status == 3){
                HdGame.statusMsg(status);
                return;
            }
            $('.ajaxLoadBg').show();
            $('.ajaxLoadBar').addClass('ajaxLoad');
            $.ajax({
                    type : 'post',
                    url : 'hdgame_h.php?cmd=checkJoinNum&aid=7167268&gameId=10&openId=o1ueSjigVd4EIc_IballnhNEJfj0',
                    error : function(){ 
                        HdGame.otherAjaxComplete();
                    },
                    success : function(data){
                        HdGame.otherAjaxComplete();
                        var result = $.parseJSON(data);
                        if(!result.isOutofJoinNum){
                            $('#ruleImg').hide();
                            $('.homeBtnBox').hide();
                            $('.footerBox').hide(); 
                            $('.home').hide();
                            $('.gameBox').show();
							gameStart();
							if(!isStart){
								$('#courseBg').show();
							}
                            /* 参与活动统计 */
                            HdGame.logDog(1000002, 22);
                        }else{
                            HdGame.statusMsg("该游戏已超过最大参与人数！");
                        }
                    }   
            });                         
        });  		
    }); 	
	
	function isIPhone4(){
		return window.navigator.userAgent.indexOf('iPhone') !== -1&&(window.screen.availHeight === 460);
	}
	function isAndroid(){
        return window.navigator.userAgent.indexOf('Android') !== -1;
    }

    function startBtnDelay(){
        var startBtn = $('#startBtnImg');
        var titleImg = $('.titleImg');
        var thisTop = parseInt(startBtn.css('top'));
        var _target = startBtn;
        if(false){
            _target = startBtn.parent();
        }
        titleImg.removeClass('titleDown').addClass('titleDown');
        _target.removeClass('startTada');
        setTimeout(function(){
            _target.addClass('startTada');
        },1000);
    }   
    
    function gamePicLayer(){
        var titleImgArgs = [];
        var titleArg = {};
        titleArg.from = "#titleImg";
        titleArg.title = '标题图片';
        titleArg.size = '520px*160px';
        titleArg.limit = '50k';
        titleArg.defSrc = '//hdg.faisys.com/image/csyx/titleImg.png';
        titleImgArgs.push(titleArg);
        
        var startImgArgs = [];
        var startArg = {};
        startArg.from = "#startBtnImg";
        startArg.title = '按钮图片';
        startArg.size = '300px*120px';
        startArg.limit = '50k';
        startArg.defSrc = '//hdg.faisys.com/image/csyx/startBtn.png';
        startImgArgs.push(startArg);
        
        var gameImgArgs = [];
        var gameArg0 = {};
        gameArg0.from = "#jumpUpImg";
        gameArg0.title = '游戏角色01';
        gameArg0.size = '160px*160px';
        gameArg0.limit = '100k';
        gameArg0.defSrc = '//hdg.faisys.com/image/csyx/p1.png';
        var gameArg1 = {};
        gameArg1.from = "#jumpDownImg";
        gameArg1.title = '游戏角色02';
        gameArg1.size = '160px*160px';
        gameArg1.limit = '100k';
        gameArg1.defSrc = '//hdg.faisys.com/image/csyx/p2.png';
        var gameArg2 = {};
        gameArg2.from = "#cloud1,#cloud2,#cloud3";
        gameArg2.title = '游戏角色03';
        gameArg2.size = '220px*60px';
        gameArg2.limit = '100k';
        gameArg2.defSrc = '//hdg.faisys.com/image/csyx/cloud.png';

        gameImgArgs.push(gameArg0);       
        gameImgArgs.push(gameArg1);
		gameImgArgs.push(gameArg2);
        
        HdGame.initModuleLayer('#titleImg',-1,"",titleImgArgs);
        HdGame.initModuleLayer('#startBtnImg',-1,"",startImgArgs);
        HdGame.initModuleLayer('#jumpUpImg',-1,"",gameImgArgs);
        HdGame.initModuleLayer('#cloud1',-1,"",gameImgArgs);
        HdGame.initModuleLayer('#cloud2',-1,"",gameImgArgs);
        HdGame.initModuleLayer('#cloud3',-1,"",gameImgArgs);
    }
    
    function init(argument) {
        var ruleImg = "//hdg.faisys.com/image/ruleImg.png";
        var sucImg = "//hdg.faisys.com/image/success.png";
        var light = "//hdg.faisys.com/image/light.png";
        var bird = "//hdg.faisys.com/image/bird.png";
        var gift = "//hdg.faisys.com/image/gift.png";
        var lots1 = "//hdg.faisys.com/image/lots1.png";
        var lots2 = "//hdg.faisys.com/image/lots2.png";
       
        if(true){
            $('#preloadPage').show();
            allImage.imgPaths = ["http://hdg.faisys.com/image/csyx/p1.png","http://hdg.faisys.com/image/csyx/p2.png","http://hdg.faisys.com/image/csyx/cloud.png","http://hdg.faisys.com/image/csyx/titleImg.png", "http://hdg.faisys.com/image/csyx/startBtn.png",
                            "http://hdg.faisys.com/image/csyx/homeBg.jpg","http://hdg.faisys.com/image/csyx/rankBtn.png","http://hdg.faisys.com/image/csyx/awardBtn.png","http://hdg.faisys.com/image/csyx/gameBg.jpg","http://7167268.h40.faiusr.com/3/ACgIABADGAAgpeSjsAUomODc2QMw7AM4nQE.gif",ruleImg,sucImg,light,bird,gift,lots1,lots2];
            var tmpPercent = 100 - allImage.imgPaths.length;   	
            loadPage(tmpPercent,startBtnDelay);//在Homepoup里
        }       
        var status = 2;
        var exlainInfo = '获奖后关注公众平台，留言兑奖码，及时查看公布获奖者名单，即可获得精美礼品一份哟。活动礼品详见公众平台。';
        var bgHeight = $(window).height()<504?504:$(window).height();
        $('#gameBgBox').css('height',bgHeight);   

        if(status == 0){
            publish = false;
            HdGame.unPublishMsg();          
        }
        if(exlainInfo.length == 0){
            $('#actExplain').hide();
        } 
		if(_manage){     
            $('.titleImg').addClass('abs');
            $('#jumpUpImg,#cloud3').addResizableFn('resize',function(event,ui) {
                $(ui.element).css('top',ui.originalPosition.top + ui.originalSize.height - parseFloat($(ui.element).css('height')));
            });
            $('.csyx_cloud').addResizableFn('resize',function(event,ui) {
                var csyx_cloud = $('.csyx_cloud').add($('.csyx_cloud').parents(".ui-wrapper"));
                csyx_cloud.css('width',$(ui.element).width());
                csyx_cloud.css('height',$(ui.element).height());
            });
            gamePicLayer();
            HdGame.moduleSlaveImgResize($('#titleImg'));
            HdGame.moduleSlaveImgResize($('#startBtnImg'));
            HdGame.moduleSlaveImgResize($('#jumpUpImg'),'#gamePlayPanel');
            HdGame.moduleSlaveImgResize($('#cloud1'));
            HdGame.moduleSlaveImgResize($('#cloud2'));
            HdGame.moduleSlaveImgResize($('#cloud3'),'#gamePlayPanel');
            HdGame.moduleDraggale('#titleImg',true);
            HdGame.moduleDraggale('#startBtnImg',true);   
            startBtnDelay();
            var reSizeDef={             //图片恢复默认参数
                titleImg     : {width:'13rem',height:'4rem'},
                startBtnImg  : {width:'7.5rem',height:'3rem'},
                jumpUpImg    : {width:'4rem',height:'4rem',left:'5rem',top:'15rem'},
                cloud1  	 : {width:'5.5rem',height:'1.5rem',left:'0rem',top:'0rem'},
                cloud2  	 : {width:'5.5rem',height:'1.5rem',left:'5rem',top:'5rem'},
                cloud3  	 : {width:'5.5rem',height:'1.5rem',left:'0rem',top:'11.5rem'}
            };
            $('.recoverBtn').click(function(){
                var wrapper = $(this).parent();
                var _from = wrapper.attr('_from');
                var slaveImg = wrapper.find('.slaveImg');
                wrapper.find('.recoverBtn').hide();
                slaveImg.attr('resize',0);
                if(wrapper.attr('resize')){
                    wrapper.attr('resize',0);
                }
				
                wrapper.css('width',reSizeDef[_from].width);
                wrapper.css('height',reSizeDef[_from].height);
                slaveImg.css('width',reSizeDef[_from].width);
                slaveImg.css('height',reSizeDef[_from].height);
                slaveImg.css('margin','auto');
				if(reSizeDef[_from].left && reSizeDef[_from].top){
                    wrapper.css('left',reSizeDef[_from].left);
                    wrapper.css('top',reSizeDef[_from].top);
                    slaveImg.css('left',reSizeDef[_from].left);
                    slaveImg.css('top',reSizeDef[_from].top);
					if(_from == 'cloud1' || _from == 'cloud2' || _from == 'cloud3'){
						for(var i = 1;i <= 3;i++){
							var cloud = $('.csyx_cloud').eq(i-1);
							cloud.parent().css('left',reSizeDef['cloud'+i].left);
							cloud.parent().css('top',reSizeDef['cloud'+i].top);
							cloud.css('left',reSizeDef['cloud'+i].left);
							cloud.css('top',reSizeDef['cloud'+i].top);
						}
						$('.csyx_cloud').parent().css('width','5.5rem');
						$('.csyx_cloud').parent().css('height','1.5rem');
						$('.csyx_cloud').css('width','5.5rem');
						$('.csyx_cloud').css('height','1.5rem');
						wrapper.css('left',reSizeDef[_from].left);
						wrapper.css('top',reSizeDef[_from].top);
						slaveImg.css('left',reSizeDef[_from].left);
						slaveImg.css('top',reSizeDef[_from].top);
					}
                }
            });
        }	
    }

    function gameInit(){
		score = 0;
		upT = 0;
		downT = 0;
		step = 0;
		level = 1;
		jumperImg.speed = jumper_speed_def;
		cloudList = [];
		_gameOver = false;
		$('#grade').html(0);
		hem = (canvas.height / 20)/ratio;		
		ctx.clearRect(0,0,gamePlayPanel_w*ratio,gamePlayPanel_h*ratio);
		
		var w = parseInt('4rem') * htmlFontSize*ratio;
        var h = parseInt('4rem') * htmlFontSize*ratio;
		
		jumperImg.y = (gamePlayPanel_h - parseInt('4rem') * htmlFontSize)*ratio;		
		jumperImg.w = w;
        jumperImg.h = h;
        jumperImg.x = 0;
		
		cloudDistance = parseInt(gamePlayPanel_h/3);	
		jumperImg.speed  = jumper_speed_def =  cloud_speed_def = speed = parseInt(10*hem);
		jumpLimit = gamePlayPanel_h/3+cloudDistance/60*hem;
		timeLimit = jumpLimit/jumperImg.speed;
		cloudTimeLimit = (cloudDistance) / speed;
		
		addCloudList(10);
		jump();	
    }

    function gameRestart() {		
        gameInit();		
    }
	
    function home(){
        $('#ruleImg').show();
        $('.homeBtnBox').show();
        $('.footerBox').show();
        $('.gameBox').hide();
        startBtnDelay();
        $('.home').show();
        $('#poupInfoBox').hide();
        $('.resuleBox').hide();
    }
	
    function gameStart() {  
		gamePlayPanel_t = parseInt($('#gamePlayPanel').css('top'));
		gamePlayPanel_h = clientHeight - gamePlayPanel_t;
		gamePlayPanel_w = $('#gamePlayPanel').width();
		$('#gamePlayPanel').height(gamePlayPanel_h);
		var backingStore = ctx.backingStorePixelRatio ||
                        ctx.webkitBackingStorePixelRatio ||
                        ctx.mozBackingStorePixelRatio ||
                        ctx.msBackingStorePixelRatio ||
                        ctx.oBackingStorePixelRatio ||
                        ctx.backingStorePixelRatio || 1;
        window.ratio = (window.devicePixelRatio || 1) / backingStore;
		canvas.width = clientWidth*ratio;
		canvas.height = gamePlayPanel_h*ratio;
		canvas.style.width = clientWidth+"px";
		canvas.style.height = gamePlayPanel_h+"px";
		
		gameInit();	
    }
		
	function addCloudList(num,h){
		var cloudH = gamePlayPanel_h - cloudDistance;
		if(h){
			cloudH = h - cloudDistance;
		}
		for(var i = 0; i < num; i++){
			var cloud = creatCloud();		
			cloud.y = cloudH*ratio;
			cloudH -= cloudDistance;
			cloudList.push(cloud);	
		}
	}
	
	function showGamePage(){
		$('#ruleImg').hide();
		$('.homeBtnBox').hide();
		$('.footerBox').hide();	
		$('.home').hide();
		$('#poupInfoBox').hide();
		$('.resuleBox').hide();
		$('.gameBox').show();	

		gamePlayPanel_h = clientHeight - parseInt($('#gamePlayPanel').css('top').replace('px',''));
		$('#gamePlayPanel').height(gamePlayPanel_h);
	}
	
	function creatCloud(){
		var cloudImg = new ImageObject();
		var rand = Math.random();
		cloudImg.image = allImage['http://hdg.faisys.com/image/csyx/cloud.png'];
		cloudImg.w = parseInt('5.5rem') * htmlFontSize*ratio;
		cloudImg.h = parseInt('1.5rem') * htmlFontSize*ratio;
		cloudImg.x = Math.floor(rand * ($(window).width()*ratio - cloudImg.w));
		if(false){
			cloudImg.x = 0;
		}		
		return cloudImg;
	}
	
	function delCloud(num){
		cloudList.splice(0,num);
	}
	
	function cloudDown(){		
		var cloudTa = 0 ;
		var currentTime = (new Date).getTime();
		var delta = (currentTime - cloudTime)/1e3;	
		delta > 0.5 && (delta = 0);
		cloudTime = currentTime;
		cloudT += delta;

		if(cloudT > cloudTimeLimit){
			delta = (cloudTimeLimit-(cloudT - delta));
			cloudT = cloudTimeLimit;	
		}	
		
		ctx.clearRect(0,0,gamePlayPanel_w*ratio,gamePlayPanel_h*ratio);	
		speed = (speed + (cloud_speed_def - (cloud_speed_def/cloudTimeLimit*cloudT)))/2;//取平均速度
		var s = level * speed * delta * 2;
		if(step == 1){
			s = s/2;
		}
		for(var i = 0; i < cloudList.length; i++){			
			cloudList[i].y += s*ratio;	
		}
		
		if(cloudT < cloudTimeLimit){//云下落
			isCloudDown = true;
			if(cloudT - delta == 0){
				upT = 0;
			}
			if(cloudT < cloudTimeLimit/level){
				jumpUp();
			}			
		}else{
			isCloudDown = false;
			fromCloud = true;
			cloudT = 0;	
			upT = timeLimit;
			// speed = cloud_speed_def
			if(step > 5){
				addCloudList(level,cloudList[cloudList.length - 1].y/ratio);		
				delCloud(level);
			}		
		}	
	}
	
	function jumpUp(){	
		jumperImg.image = allImage['http://hdg.faisys.com/image/csyx/p1.png'];								
		if(isStart){
			upT += delta;
			if(upT > timeLimit){//到达最高点				
				delta = (timeLimit-(upT - delta));
				upT = timeLimit;				
			}
			if(isCloudDown){
				if(upT > cloudTimeLimit/level){
					delta = (cloudTimeLimit/level-(upT - delta));
					upT = cloudTimeLimit/level;
				}
			}
			jumperImg.speed = (jumperImg.speed + (jumper_speed_def - (jumper_speed_def/timeLimit*upT)))/2;
			if(isCloudDown){
				if(step == 1){
					jumperImg.y -= jumperImg.speed*delta*level*ratio;
				}else{
					jumperImg.y -= (jumperImg.speed*delta*level/2)*ratio;
				}
				
			}else{
				jumperImg.y -= jumperImg.speed*delta*2*level*ratio;
			}		
		}	
	}
		
	function jumpDown(){		
		jumperImg.image = allImage['http://hdg.faisys.com/image/csyx/p2.png'];		
		downT += delta;
		
		for(var i = 0; i < cloudList.length; i++){
			var cloudL = cloudList[i].x;
			var cloudR = cloudList[i].x + cloudList[i].w;
			var cjS = (jumperImg.y + jumperImg.h) - (cloudList[i].y + cloudList[i].h);
			if(Math.abs(cjS) < jumper_speed_def*delta*level*ratio){//踩到云
				if((jumperImg.x + (2*jumperImg.w/3)) > cloudL && (jumperImg.x) < cloudR - (1*jumperImg.w/3)){					
					if(!cloudList[i].flag){
						stepCloud();					
					}else{
						upT = 0;
						downT = 0;
					}
					cloudList[i].flag = true;
					return;
				}	
			}
		}
		
		jumperImg.speed = (jumper_speed_def/timeLimit)*downT;
		if(jumperImg.y < (gamePlayPanel_h - parseInt('4rem') * htmlFontSize)*ratio){			
			jumperImg.y += jumperImg.speed*delta*2*level*ratio;			
		}else{//到最低点
			if(step > 5){
				jumperImg.y += jumperImg.speed*delta*level*ratio;
				if(jumperImg.y > gamePlayPanel_h*ratio){
					_gameOver = true;
					gameOver(score);					
				}
			}else{
				isup = true;
			}			
		}						
	}
	
	function stepCloud(){
		isup = true;
		score += level*10;
		step ++;
		$('.grade').html(score);
		if(step/20 == level){
			level ++;
		} 
		cloudTime = (new Date).getTime();					
		cloudDown();		
        musicList[1].optFlag != 1 && !g_pauseMusic && createjs.Sound.play("win");
	}
	
	function jump(){
		if(_gameOver){
			return;
		}	
		ctx.clearRect(0,0,gamePlayPanel_w*ratio,gamePlayPanel_h*ratio);
		var currentTime = (new Date).getTime();
		delta = (currentTime - jumperImg.time)/1e3;	
		delta > 0.5 && (delta = 0);
			
		jumperImg.time = currentTime;
		if(isStart){
			if(isAndroid()){
				jumperImg.x -= x*ratio;
			}else{
				jumperImg.x += x*ratio;
			}
		}	
		
		//屏幕穿梭
		if(jumperImg.x < -jumperImg.w){
			jumperImg.x = $(window).width()*ratio;
		}
		if(jumperImg.x > $(window).width()*ratio){
			jumperImg.x = -jumperImg.w;
		}		

		if(isCloudDown){
			cloudDown();	
		}else{
			if(upT < timeLimit || isup ){
				if(isup){
					if(!fromCloud){
						upT = 0;					
					}else{
						fromCloud = false;						
					}
					downT = 0;
					isup = false;
				}
				jumpUp();				
			}else{
				jumpDown();
			}
		}
		
		for(var i = 0; i < cloudList.length; i++){
			drawImg(cloudList[i]);
		}
		
		drawImg(jumperImg);	
		requestAnimFrame(jump);	
	}
		
	function ImageObject(){
		this.x = 0;
		this.y = 0;
		this.w = 0;
		this.h = 0;
		this.speed = 5;
		this.flag = false;
		this.time = (new Date).getTime();
		this.image = new Image();
	}
	
	function drawImg(t){console.log(t);
    	ctx.drawImage(t.image,t.x,t.y,t.w,t.h);
    }	
	
	var deviceMotionHandler=(function(){
		var last_update = 0; 
		x = y = z = 0;

		var curTime=0;
		return function (eventData){
			curTime = new Date().getTime();  		
			if ((curTime - last_update) > 100){  
				var acceleration = eventData.accelerationIncludingGravity;  
				last_update = curTime;  
				x = acceleration.x;
				y = acceleration.y;
				z = acceleration.z;	
			}				
		}  
	})();	
</script>   
</head>
<body class="gameTpl_-1">
    <input id="jumpDownImg" type="hidden" value="http://hdg.faisys.com/image/csyx/p2.png">
    <div class="ajaxLoadBg">
        <div class="ajaxLoadBar "></div>
    </div>
    <div class="body">      
        <div id="ruleImg" _mousein="0" ontouchend="HdGame.changePoup(2,'//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRankList&amp;aid=7167268&amp;gameId=10&amp;style=15&amp;openId=o1ueSjigVd4EIc_IballnhNEJfj0','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getGiftList&amp;aid=7167268&amp;style=15','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRegAwardList&amp;aid=7167268&amp;gameId=10&amp;style=15&amp;openId=o1ueSjigVd4EIc_IballnhNEJfj0','o1ueSjigVd4EIc_IballnhNEJfj0',10,false,true);"></div>
        <div class="home">
            <div id="homeBgBox" style="height: 1110px;">
                <img id="homeBg" src="http://hdg.faisys.com/image/csyx/homeBg.jpg">    
            </div>  
            <div class="gameInfoBox">
                <div class="titleImg imgContainer absCenter titleDown">
                    <img id="titleImg" class="slaveImg abs" src="http://hdg.faisys.com/image/csyx/titleImg.png" style="width:13rem;height:4rem;top:2.55rem;left:1.55rem;">
                </div>               
            </div>
			

	<div id="joinNumLine" class="joinNumLine absCenter" style="top:6.95rem;left:3.55rem;color:rgb(255, 255, 255);font-size:0.6rem; text-shadow:none;">
	已有 <span id="joinNum" class="specil" style="color:rgb(255, 247, 153);font-size:0.9rem;text-shadow:none;">327</span> 人参加活动</div>
	
            <div id="startBtn" class="startBtn imgContainer absCenter" style="top:0rem;">
                <img id="startBtnImg" class="slaveImg abs startTada" src="http://hdg.faisys.com/image/csyx/startBtn.png" style="width:7.5rem;height:3rem;top:16.9rem;left:4.1rem;">    
            </div>
        <div class="bottomSkill skillInfo" style="display: none; top: 1053px;">游戏技术由 凡科互动 提供</div></div>
        <div class="gameBox hide gameBgBox">
            <div id="gameBgBox" style="height: 826px;">
                <img id="gameBg" src="http://hdg.faisys.com/image/csyx/gameBg.jpg" style="width:100%;height:auto;">
				<div id="courseBg" class="course bg hide"></div>	
            </div>
            
<div id="gameTopBar" class="gameTopBar" style="color:rgb(255, 255, 255);background-color:rgba(255, 255, 255, 0)">
	<div class="userInfoBox">
		<div class="userImgBox" style="border-color:rgb(255, 255, 255)"><img src="http://wx.qlogo.cn/mmopen/aD34PShiaoar94D1IjiagE76McesibrtN5MhFEJ1XnRnw3Av2ywtuJPaYia5a0lx8nmKvjyiaKGCTzwNPQSxGRUQ6rcCic1FtbwKK7/0" class="userImg"></div>
					
			<div id="grade" class="grade">0</div>
			
	</div>
	
</div>	
			<div id="gamePlayPanel" class="gamePlayPanel">
				
				<canvas id="canvas">你的浏览器不支持canvas，请换个牛逼点的浏览器，谢谢</canvas>
			</div>
        </div>     
        

<!-- 活动规则，排行榜，我的奖品的弹出层 -->
<div id="poupInfoBox">
	<div class="poupHead">
		<div class="poupTitle">活动及奖品说明</div>
		<div class="poupClose"></div>
	</div>
	<div id="ruleBox" class="poupMain" style="display:none;-webkit-overflow-scrolling:touch;">
		<div id="getHeight">
			<div id="awardLine" class="poupLine">
                <div class="mainTitle">活动奖品</div>
                <div id="awardLineBox">
				<div class="unComfortLine"><span class="awardStyle">一等奖</span> : <span class="award">牛奶杯一个</span></div>
<div class="unComfortLine"><span class="awardStyle">二等奖</span> : <span class="award">星空投影灯一个</span></div>
<div class="unComfortLine"><span class="awardStyle">三等奖</span> : <span class="award">卡包一个</span></div>

				<div id="comfortLine" class="hide" style="font-size: 0.6rem;"><span class="awardStyle">null</span> : <span class="award">null</span></div>
	
            </div>	
            <div id="selfAwardLine" class="hide" style="word-wrap: break-word; display: none;"></div>
		</div>
			
			<div id="gameDateTime" class="poupLine">
                <div class="mainTitle">活动时间</div>
				<p><span id="startDate">2015年11月4日 17:00</span>&nbsp;-&nbsp;<span id="endDate">2016年11月11日 17:00</span></p>
			</div>	
            <div class="hostLine poupLine">
                <div class="mainTitle">主办单位</div>
                <p>活动最终解释权归 <a class="hostName" href="http://123456">晋商银行孝义支行</a> 拥有</p>
            </div>
		</div>	
		<div id="explainBox" class="poupLine">
            <div class="mainTitle">活动及兑奖说明</div>
			<p><span id="haveScore">游戏达到 <span id="scoreLimit" class="scoreLimit">500</span> 分即可获得抽奖机会，</span>
            
            每人每日有 <span id="drawTimesLimit">1</span> 次抽奖机会。<br>
            </p>
			<div id="exlainInfo">获奖后关注公众平台，留言兑奖码，及时查看公布获奖者名单，即可获得精美礼品一份哟。活动礼品详见公众平台。</div>
		</div>
	</div>
	<div id="rankBox" class="poupMain hide" style="-webkit-overflow-scrolling:touch;">
		<div id="noRank" class="hide">暂无排名</div>
		<div id="rankMain" class="getRankHeight hide">
			<div style="margin-top:0.7rem;margin-left: 0.25rem;">当前排名：<span id="rank"></span> （只显示前50名）</div>
			<div style="padding:0rem 0.5rem">					
				<table class="rankTable" cellspacing="0" cellpadding="0">
					<thead>
						<tr style="line-height: 1rem;">
							<th>排行</th>
							<th>头像</th>
							<th>昵称</th>
							<th>成绩</th>
						</tr>
					</thead>		
				</table>
			</div>
		</div>		
		<div id="rankHeight">
			<table id="rankInfoBox" class="rankTable" cellspacing="0" cellpadding="0" style="margin-top: 0;">
			</table>
		</div>				
	</div>
	<div id="awardBox" class="poupMain hide">
		<div id="awardInfo">暂无中奖纪录</div>
        <div id="awardScrollWrap" style="overflow:auto;">
    		<div>
                <div class="hostLine poupLine">
                    <div class="mainTitle">主办单位</div>
                    <p>活动最终解释权归 <a class="hostName" href="http://123456">晋商银行孝义支行</a> 拥有</p>
                </div>
    			<div id="awardExplainBox" class="poupLine">
                    <div id="awardExplain_h" class="mainTitle">活动及兑奖说明</div>
                    <div id="awardExplain" class="explain">获奖后关注公众平台，留言兑奖码，及时查看公布获奖者名单，即可获得精美礼品一份哟。活动礼品详见公众平台。</div>
                </div>
    		</div>
        </div>
        <div class="attentionBox">
            <div class="menuBtnBox">
              <a class="menuName" href="###">关注我们吧</a>
            </div>
            <div class="skillInfo" style="display: none;"><a href="http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&amp;mid=209854000&amp;idx=1&amp;sn=82241d924839270d3ea820ad2d56c01b#rd">我也要免费创建活动</a><span class="gotoFlag"></span></div>
            <div class="holdBox"></div>
        </div>
	</div>
	<div id="regAwardBox" class="poupMain hide" style="-webkit-overflow-scrolling:touch;">
		<div id="noRegAward" class="hide" style="margin-left:3px;">尚未公布获奖名单，详情请查看活动说明</div>
		<div id="regAwardMain">
					
					<div class="regAwardList">
						<div class="mainTitle">一等奖</div>
						<div class="playerName" style="margin-bottom:12px;"></div>
					</div>	
					
					<div class="regAwardList">
						<div class="mainTitle">二等奖</div>
						<div class="playerName" style="margin-bottom:12px;"></div>
					</div>	
					
					<div class="regAwardList">
						<div class="mainTitle">三等奖</div>
						<div class="playerName" style="margin-bottom:12px;"></div>
					</div>	
			
			
		</div>	
	</div>
</div>
<!-- 右侧按钮 -->
<div class="homeBtnBox">
	
	
	<div id="rankBtn" ontouchend="HdGame.changePoup(1,'//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRankList&amp;aid=7167268&amp;gameId=10&amp;style=15&amp;openId=o1ueSjigVd4EIc_IballnhNEJfj0','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getGiftList&amp;aid=7167268&amp;style=15','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRegAwardList&amp;aid=7167268&amp;gameId=10&amp;style=15&amp;openId=o1ueSjigVd4EIc_IballnhNEJfj0','o1ueSjigVd4EIc_IballnhNEJfj0',10);">		<img src="http://hdg.faisys.com/image/csyx/rankBtn.png" style="width:1.5rem;height:1.5rem"></div>
    
	<div id="awardBtn" style="position:relative;" ontouchend="HdGame.changePoup(3,'//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRankList&amp;aid=7167268&amp;gameId=10&amp;style=15&amp;openId=o1ueSjigVd4EIc_IballnhNEJfj0','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getGiftList&amp;aid=7167268&amp;style=15','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRegAwardList&amp;aid=7167268&amp;gameId=10&amp;style=15&amp;openId=o1ueSjigVd4EIc_IballnhNEJfj0','o1ueSjigVd4EIc_IballnhNEJfj0',10);">
		<span id="Award_Round_Dot" class="redDot hide"></span>
		<img src="http://hdg.faisys.com/image/csyx/awardBtn.png" style="width:1.5rem;height:1.5rem;">
	</div>
</div>
<!-- logo -->
<div id="logoImgBox" class="logoImgBox imgContainer absCenter footerBox">
    <img id="logoImg" class="slaveImg abs" src="http://7167268.h40.faiusr.com/3/ACgIABADGAAgpeSjsAUomODc2QMw7AM4nQE.gif" style="width:10rem;height:2.9rem;top:0rem;left:0rem;">
</div>
<!-- 结果弹出层 -->
<div class="resuleBox hide">

    <div id="resule-status-box" style="display:none">
        <div id="resule-status-scrollWrap">
            <div class="resule-bgLight"></div>
            <div id="resule-status-bird"></div>
            <div id="resule-status-head">
                <div class="resule-status-userImg">
                    <img src="http://wx.qlogo.cn/mmopen/aD34PShiaoar94D1IjiagE76McesibrtN5MhFEJ1XnRnw3Av2ywtuJPaYia5a0lx8nmKvjyiaKGCTzwNPQSxGRUQ6rcCic1FtbwKK7/0">
                </div>
                <div id="resule-status-ribbon" class="resule-status-ribbon"></div>
            </div>
			<div id="resule-status-body">
				<p style="font-size:0.8rem; line-height:1.2rem">您的成绩为：<span class="resuleArg"></span>分</p>
				<p class="resule-status-minscore" style="display:none;">成绩必须达到 <span class="resuleArg resulescoreLimit"></span> 分才能抽奖</p>
				<p style="margin-top:0.5rem">最佳成绩为：<span class="resuleArg"></span>分</p>

				<p>最佳排名为：NO.<span class="resuleArg"></span></p>
				<p id="resule-status-count" style="margin-top:0.6rem">您今天还有 <span class="resuleArg"></span> 次机会抽奖</p>
			</div>
			<div id="resule-status-other" class="hide">
				<p style="font-size:0.8rem;font-weight:bold;">通过并且</p>
				<p class="resule-status-minscore hide" style="margin: 10px 0px 50px;">成绩必须达到 <span class="resuleArg resuleArg-fail resulescoreLimit"></span> 分才能抽奖</p>
			</div>
			<div id="resule-sucReg" class="hide" style="margin-top:0.6rem">您已经成功报名参与活动！</div>
            <div id="resule-foot-box">				
                <div class="resule-foot-one">
                    <div class="resule-button resule-one-button resule-status-gift hide">赶紧去抽奖</div>
                    <div class="resule-button resule-one-button resule-status-reg hide">我要报名</div>
                    <div class="resule-button resule-one-button resule-status-again hide">再玩一次</div>
                </div>
                <div class="resule-foot-two">
                    <div class="resule-button resule-status-seeRank">排行榜</div><div class="resule-button resule-status-home">返回首页</div><div class="resule-button resule-status-again">再玩一次</div>
                </div>
            </div>
        </div>
        <div id="resule-status-lotsBox" style="display:none">
            <div id="resule-status-lots"></div>
            <div id="resule-status-lotsHand"></div>
        </div>
		
    </div>

    <div id="resule-gift-box" style="display:none">
        <div id="resule-gift-scrollWrap" class="resule-gift-overflowScrolling" style="padding-top: 1.2rem;">
            <div class="resule-bgLight"></div>
            <div id="resule-gift-jiantou" class="resule-fxts resule-fxts_s"></div>
            <div style="position:absolute; width: 100%;">
                <p id="resule-gift-luck" style="text-align:center;font-size:1rem;">恭喜你中奖了!</p>
                <div id="resule-gift-sucImg" style="margin-top:1.2rem;"></div>
                <div id="resule-gift-foot">
                    <p id="resule-gift-rank"> <span class="gifArg"></span> </p>
                    <p id="resule-gift-goods"> <span class="gifArg"></span> </p>
                    <p id="resule-gift-code">兑奖码：<span class="gifArg"></span></p>
                    <p id="resule-gift-explain" style="text-align:left;">获奖后关注公众平台，留言兑奖码，及时查看公布获奖者名单，即可获得精美礼品一份哟。活动礼品详见公众平台。</p>
                </div>
            </div>
        </div>
        <!-- <div id="faiImgBox" class="imgContainer absCenter hide" >
            <img id="resule-faiImg" class="slaveImg abs" src="//hdg.faisys.com/image/csyx/faiImg.png" style="width:15rem;height:18rem;top:0.5rem;left:0.5rem;"/>
        </div> -->
         <div id="faiImgBox">
			<div class="resule-fxts resule-fxts_c"></div>
            <img class="abs" src="//hdg.faisys.com/image/faiImg.png?v=201509171041" style="width:15rem;height:18rem;top:2.5rem;left:0.5rem;">
        </div>
        <div class="attentionBox">
            <div class="menuBtnBox">
              <a class="menuName" href="###">关注我们吧</a>
            </div>
            <div class="skillInfo" style="display: none;"><a href="http://mp.weixin.qq.com/s?__biz=MjM5MTk5MjI3OA==&amp;mid=209854000&amp;idx=1&amp;sn=82241d924839270d3ea820ad2d56c01b#rd">我也要免费创建活动</a><span class="gotoFlag"></span></div>
            <div class="holdBox"></div>
        </div>
    </div>
</div>

<!-- 一键关注弹出页 -->
<div id="attentionMask" class="homePoupMask">
    <div id="attentionPoup" class="homePoupInner">
        <img src="//hdg.faisys.com/image/caewm.jpg?v=201506151818">
        <img id="QRImg" src="http://7167268.h40.faiusr.com/2/ACgIABACGAAg_Yv-rwUo2oKBzQIwggI4ggI.jpg">
    </div>
</div>


<!-- 技术支持弹出页 -->
<div id="skillSupMask" class="homePoupMask">
    <div id="skillSupPoup" class="homePoupInner">
        <div id="faiQRcode">
            <img src="//hdg.faisys.com/image/eweima.png?v=201506181818">
        </div>
        <p>关注凡科互动</p>
        <p>免费创建游戏营销</p>
    </div>
</div>


<!-- loading页面 -->
<div id="preloadPage" class="bg leftClose" style="display: none;">
    <div id="preloadPageCover" style="display: none;"></div>
    <div id="bottomPage" style="top: -132.828125px; transform: rotate(-72.370899824448deg); -webkit-transform: rotate(-72.370899824448deg);">
        <div class="bp leftCover"></div>
        <div class="bp pallet leftPallet" style="transform: rotate(180deg); -webkit-transform: rotate(180deg);"></div>
        <div class="bp pallet rightPallet" style="display: block; transform: rotate(360deg); -webkit-transform: rotate(360deg);"></div>
    </div>
    <div id="infoLogoBox" style="left: -386.5px;">
        <div id="infoLogoWrap" style="border-radius: 0.2rem; border-color: transparent;">
            <div id="infoLogo" style="width: 378.5px; height: 120.278888888889px; border-radius: 0.2rem;">
        
            <img src="http://7167268.h40.faiusr.com/3/ACgIABADGAAgpeSjsAUomODc2QMw7AM4nQE!450x450.gif">
        
            </div>
        </div>
    </div>
    <div class="info" style="top: 357.253125px;">加载中 <span id="loadPercent">100</span>/100...</div>
</div>


<script type="text/javascript">
    var pubResizeDef={             //图片恢复默认参数
        'logoImg'         : {width:'2rem',height:'2rem'},
        'resule-faiImg'   : {width:'15rem',height:'18rem'},
    };
	function homeBtnLayer(){
		var rankImgArgs = [];
		var rankArg ={};
		rankArg.from = "#rankBtn img";
		rankArg.title = '按钮图片';
		rankArg.size = '70px*70px';
		rankArg.limit = '50k';
		rankArg.src = $('#rankBtn img').attr('src');
		rankArg.defSrc = '//hdg.faisys.com/image/csyx/rankBtn.png';
		rankImgArgs.push(rankArg);
		var awardImgArgs = [];
		var awardArg ={};
		awardArg.from = "#awardBtn img";
		awardArg.title = '按钮图片';
		awardArg.size = '70px*70px';
		awardArg.limit = '50k';
		awardArg.src = $('#awardBtn img').attr('src');
		awardArg.defSrc = '//hdg.faisys.com/image/csyx/awardBtn.png'
		awardImgArgs.push(awardArg);

		var mingdanImgArgs = [];
		var mingdanArg ={};
		mingdanArg.from = "#mingdanBtn img";
		mingdanArg.title = '按钮图片';
		mingdanArg.size = '70px*70px';
		mingdanArg.limit = '50k';
		mingdanArg.src = $('#mingdanBtn img').attr('src');
		mingdanArg.defSrc = '//hdg.faisys.com/image/csyx/bmx.png'
		mingdanImgArgs.push(mingdanArg);

        var faiImgArgs = [];
        var faiImgArg = {};
        faiImgArg.from = "#resule-faiImg";
        faiImgArg.title = '不中奖图片';
        faiImgArg.size = '600px*720px';
        faiImgArg.limit = '200k';
        faiImgArg.src = $('#resule-faiImg').attr('src');
        faiImgArg.defSrc = '//hdg.faisys.com/image/csyx/faiImg.png';
        faiImgArgs.push(faiImgArg);
		
        HdGame.initModuleLayer('#resule-faiImg',-1,"",faiImgArgs);
        HdGame.moduleSlaveImgResize($('#resule-faiImg'),'#resule-gift-box');
        HdGame.moduleDraggale('#resule-faiImg',true,'#resule-gift-box');
		HdGame.initModuleLayer('#rankBtn',-1,"",rankImgArgs);
		HdGame.initModuleLayer('#awardBtn',-1,"",awardImgArgs);
		HdGame.initModuleLayer('#mingdanBtn',-1,"",mingdanImgArgs);
	}

	//刚进来的进度页面
	function loadPage(tmpPercent,callBack){
        var i = 1,
            outTime = 30,//超时时间
            logoImg=new Image(),
            numLoaded = 0,
            loadingTimer = null,
            loadPallet,
            $infoLogoImg = $('#infoLogo img'),
            $infoLogo = $('#infoLogo'),
            $infoLogoBox = $('#infoLogoBox'),
            $infoLogoWrap = $('#infoLogoWrap'),
            $rightPallet = $('#bottomPage .rightPallet'),
            $leftPallet = $('#bottomPage .leftPallet'),
            $loadPercent = $('#loadPercent');
        if(true){
            allImage.imgPaths.push('//hdg.faisys.com/image/csyx/faiImg.png');
        }
        if(false){
            $('#bottomPage,#bottomPage .leftCover').css('background-color','#fff');
            $('#preloadPageCover').hide();
            loadimg(allImage.imgPaths);
        }else if(false){
            $('#preloadPage .info').css('top',$(window).height()/2 - $('#preloadPage .info').outerHeight()/2);
            $('#preloadPageCover').hide();
            loadimg(allImage.imgPaths);
        }else if(true){
            HdGame.imgReady("http://7167268.h40.faiusr.com/3/ACgIABADGAAgpeSjsAUomODc2QMw7AM4nQE!450x450.gif",function(){
                setLogoSize(this.height,this.width);
            });
        }
        function setLogoSize(h,w){
            var bottomPageInfoDeg = -Math.atan(w/h)*180/Math.PI;
            $infoLogo.css({
                'width': w ,
                'height': h ,
                'border-radius':'0.2rem'
            });
            $infoLogoWrap.css({
                'border-radius':'0.2rem',
                'border-color':'transparent',
            });
            if(h === w ){
                if(h > 3.5*g_rem){
                    $infoLogo.css({ 'width': 3.5*g_rem ,'height': 3.5*g_rem });
                }
                $infoLogo.css('border-radius','50%')
                $infoLogoWrap.css('border-radius','50%');
                $infoLogoBox.css('border-radius','50%');
                $infoLogoImg.css('border-radius','50%');
            }else if(w > h && w > 8*g_rem){
                $infoLogo.css({ 'width': 8*g_rem ,'height': 8*g_rem*h/w });
            }else if(h > w && h > 8*g_rem){
                $infoLogo.css({ 'width': 8*g_rem*w/h ,'height': 8*g_rem });
            }
            $('#bottomPage').css({
                'top' : $infoLogoBox.outerHeight()/2 + parseFloat($infoLogoBox.css('top')) - $('#bottomPage').outerHeight()/2,
                'transform':'rotate('+bottomPageInfoDeg+'deg)',
                '-webkit-transform':'rotate('+bottomPageInfoDeg+'deg)',
                '-moz-transform':'rotate('+bottomPageInfoDeg+'deg)',
                '-o-transform':'rotate('+bottomPageInfoDeg+'deg)'
            })
            $infoLogoBox.css('left' , (16*g_rem - $infoLogoBox.outerWidth())/2);
            $('#preloadPage .info').css('top',$infoLogoBox.outerHeight()/2 + parseFloat($infoLogoBox.css('top')) + $infoLogoWrap.outerHeight()/2 + 0.9*g_rem);
            loadPallet = function(tmp){
                if(tmp > 50 && tmp <= 100){
                    $rightPallet.show().css({
                        'transform':'rotate('+tmp*3.6+'deg)',
                        '-webkit-transform':'rotate('+tmp*3.6+'deg)',
                        '-moz-transform':'rotate('+tmp*3.6+'deg)',
                        '-o-transform':'rotate('+tmp*3.6+'deg)'
                    });
                }else if(tmp <= 50){
                    $leftPallet.css({
                        'transform':'rotate('+tmp*3.6+'deg)',
                        '-webkit-transform':'rotate('+tmp*3.6+'deg)',
                        '-moz-transform':'rotate('+tmp*3.6+'deg)',
                        '-o-transform':'rotate('+tmp*3.6+'deg)'
                    });
                }
            };
            $('#preloadPageCover').hide();
            loadimg(allImage.imgPaths);//页面所有缓存好的image对象数组
        }
        
        function loading(){
            if(numLoaded < allImage.imgPaths.length){
                if(i <= 100 - allImage.imgPaths.length + numLoaded){
                    i++;
                    $loadPercent.text(i);
                    loadPallet && loadPallet(i);
                }
            }else{
                i += 10;
                i > 50 && i < 60 && (i = 50);
                i > 100 && (i = 100);
                $loadPercent.text(i);
                loadPallet && loadPallet(i);
            }
            if(i >= 100){
                //return;
                clearTimeout(loadingTimer);
                var flag = $(window).height()/$(window).width() < 1.5;
                var bgHeight = flag ? $(window).width()*1.5 : $(window).height();
                setTimeout(function(){
                    $('#preloadPage').addClass('leftClose');
                    $('#homeBgBox').css('height',bgHeight);
                    flag && $('.home .bottomSkill').css('top',bgHeight - $('.bottomSkill').outerHeight());
                    setTimeout(function(){
                        $('#preloadPage').hide();
                    },400);
                    callBack && callBack();
                },50);
                return;
            }
            loadingTimer = setTimeout(arguments.callee,10);
        }
        //预加载图片
        function loadimg(arr,funLoading,funOnLoad,funOnError){  
            var numError=0,  
            isObject=Object.prototype.toString.call(arr)==="[object Object]" ? true : false;  
            var arr= isObject ? arr.get() : arr; 
            loading(); 
            for(a in arr){  
                var src=isObject ? $(arr[a]).attr("data-src") : arr[a]; 
				preloadImg(src,arr[a]);                    
            }  
            function preloadImg(src,obj){  
                var img=new Image();  
                img.onload=function(){          
                    numLoaded++; 
                    allImage[src]=img;
                    if(numLoaded === arr.length){
                        allImage.complete = true;
                        $.each(allImage.readyCallBack,function(index,fn){
                            fn();
                        });
                    }
                    funLoading && funLoading(numLoaded,arr.length,src,obj);  
                    funOnLoad && numLoaded==arr.length && funOnLoad(numError);  
                };  
                img.onerror=function(){  
                    numLoaded++;  
                    numError++;  
                    allImage[src]=img;
                    if(numLoaded === arr.length){
                        allImage.complete = true;
                        $.each(allImage.readyCallBack,function(index,fn) {
                            fn();
                        });
                    }
                    funOnError && funOnError(numLoaded,arr.length,src,obj);  
                }  
                img.src=src; 
            }		
        }
	}
	
	  	
	$(function(){
		var hostLink = 'http://123456'.replace('http://','');
        var menuLink = 'http://7167268.h40.faiusr.com/2/ACgIABACGAAg_Yv-rwUo2oKBzQIwggI4ggI.jpg'.replace('http://','');
        var menuName = $('.menuName');
        $(document).on('touchstart',function(event){});
		if(false){
			$('.resule-fxts').hide();
		}
        true && g_showSkillSup && HdGame.logDog(1000028,0);
        $('.home').append('<div class="bottomSkill skillInfo">游戏技术由 凡科互动 提供</div>');

        //音乐图标插入游戏位置
        
		var isSelAwardLine = false;
        _manage && $('a').on('click',function(){ return false; });
        $('.homePoupMask').on('touchend',function(event){
            event.preventDefault();
            event.stopPropagation();
            if(_manage){
                return;
            }
            if($(event.target).hasClass('homePoupMask')){
                $(this).hide();
            }
        });
		var showRedDot = false;
		var showMDRedDot = false;
        $('.menuBtnBox').on('touchend',function(){
            HdGame.logDog(1000012);
        });
		if(true){
			$('#joinNumLine').show();
		}else{
			$('#joinNumLine').hide();
		}
		if(showRedDot){
			$('#Award_Round_Dot').css('display','inline-block');
		}
		if(showMDRedDot){
			$('#Mingdan_Round_Dot').css('display','inline-block');
		}
		if(isSelAwardLine){			
			$('#selfAwardLine').show();
            $('#awardLineBox').hide();
		}else{
			$('#awardLineBox').show();
            $('#selfAwardLine').hide();
		}
        if(!false){
            $('.skillInfo').hide();
        }
        if(false){
            $('.menuBtnBox').hide();
        }else if(false){
            if($.trim(menuLink).length == 0){
                menuName.css('text-decoration','none');
                menuName.attr('href','#');
            }else{
                menuName.attr('href','http://7167268.h40.faiusr.com/2/ACgIABACGAAg_Yv-rwUo2oKBzQIwggI4ggI.jpg');
            }
        }else if(true){
            (function(){
                var attentionMask = $('#attentionMask');
                if('http://7167268.h40.faiusr.com/2/ACgIABACGAAg_Yv-rwUo2oKBzQIwggI4ggI.jpg' === ''){
                    $('#QRImg').remove();
                }
                $('.menuBtnBox').on('touchend',function(){
                    attentionMask.show();
                });
            })();
        }
		if($.trim(hostLink).length == 0){
			$('.hostName').css('text-decoration','none');
			$('.hostName').attr('href','#');
		}
		//音乐图标旋转
		var rotation = function(){
			$('.soundIcon').rotate({
			    angle: 0, 
			    animateTo: 360, 
			    callback: rotation,
			    easing: function(x,t,b,c,d){
			        return c*(t/d)+b;
			    }
			});
		}
		
        if(!_manage){
            createjs.Sound.registerSound({src: _resRoot + "/image/button.mp3", id: "startButton"});
            //rotation();//音乐图标旋转调用
            $('#startBtnImg').on('touchend',function(e){
                createjs.Sound.play("startButton");
            });
            //音乐图标点击事件
            $('.soundIcon').click(function(){
                var style = 15;
                var self = $('.soundIcon');
                if(self.attr('_clickIn') == 0){
                    self.addClass("soundIconOff");
                    self.attr('_clickIn','1');
                    //关闭音乐
                    $('.soundIcon').stopRotate();
                    g_pauseMusic = true;
                    musicList[0].optFlag != 1 && createjs.Sound.stop("start");//关闭背景音乐
                    if(musicList[1]){
                        musicList[1].optFlag != 1 && createjs.Sound.stop("win");
                    }
                    if(musicList[2]){
                        musicList[2].optFlag != 1 && createjs.Sound.stop("lost");
                    }
                }
                else{
                	rotation();
                    g_pauseMusic = false;
                    musicList[0].optFlag != 1 && createjs.Sound.play("start");
                    self.removeClass("soundIconOff");
                    self.attr('_clickIn','0');
                }
            });
        }
		
		//管理态下绑定虚线编辑框
		
		if($('#awardExplain').text().length == 0){
			$('#awardExplain_h').hide();
		}
        $('.hostName').click(function(){
			HdGame.logDog(1000013);
        });
        $('.skillInfo a').click(function(){
            HdGame.logDog(1000005);
        });
	});

	function showRank(){
		HdGame.changePoup(1,'//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRankList&aid=7167268&gameId=10&style=15&openId=o1ueSjigVd4EIc_IballnhNEJfj0','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getGiftList&aid=7167268&style=15','//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getRegAwardList&aid=7167268&gameId=10&style=15&openId=o1ueSjigVd4EIc_IballnhNEJfj0','o1ueSjigVd4EIc_IballnhNEJfj0',10,false);
	}

    
    
    function gameOver(_gameScore,callBack){
		if(_gameScore === 'fail'){
			var arg={
				isSuc:false,
				gameScore:"fail",//闯关失败
				minScore:500,
				bestScore:0,
				isReg:HdGame.isReg, //是否报名
				gameType:0,
				rank:0,
				count:drawTimesLimit-count<0 ? 0:(drawTimesLimit-count)                     
			};
			setTimeout(function(){
				HdGame.resulePoup.show(arg);
			},900);
			return;
		}
        /*var MaxScore = 12312;
        if(true){//检测是否为有效分数
            if(_gameScore >= MaxScore){
                var unScuScore = 500 - 10;
                _gameScore = unScuScore < 0 ? 0 : unScuScore;
            }
        }else if(false){
            if(_gameScore <= MaxScore){
                _gameScore = 500 + 10;
            }
        }*/
        $('.ajaxLoadBg').show();
        $('.ajaxLoadBar').addClass('ajaxLoad');
        var _gameScoreStr = _gameScore+'';
        if(false){
            _gameScoreStr = changeTwoDecimal_f(_gameScore);
        }
        var drawTimesLimit = 1;
        var info = {};
        info.headImg = "http://wx.qlogo.cn/mmopen/aD34PShiaoar94D1IjiagE76McesibrtN5MhFEJ1XnRnw3Av2ywtuJPaYia5a0lx8nmKvjyiaKGCTzwNPQSxGRUQ6rcCic1FtbwKK7/0";
        var params = new Array();
        params.push("gameId=",10);
        params.push("&style=",15);
        params.push("&achieve=",HdGame.encodeBase64('"'+_gameScoreStr+'"') + $.md5(7167268));
        params.push("&openId=","o1ueSjigVd4EIc_IballnhNEJfj0");
        params.push("&name=","kylst");
        params.push("&=drawLimit",500);
        
        params.push('&info=',$.toJSON(info));
        $.ajax({
            type : 'post',
            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=setAchieve&aid=7167268',
            data : params.join(''),
            error : function(){               
                HdGame.otherAjaxComplete();
                $('#timeUpImg,.timeUpImg').removeClass('tada');
                callBack && callBack({
                    rt:-999,
                    msg:"ajax返回错误"
                });
                HdGame.tlog($.toJSON(arguments)); 
            },
            success : function(data){  
                HdGame.tlog(data);                 
                var r = $.parseJSON(data);
                HdGame.otherAjaxComplete(); 
                if(r.rt == 0){
                    var arg={
                        isSuc:r.isSuc,
                        gameScore:_gameScoreStr,
                        minScore:500,
                        bestScore:r.achieve,
                        isReg:HdGame.isReg, //是否报名
                        gameType:0,
                        rank:r.rank,
                        count:drawTimesLimit-count<0 ? 0:(drawTimesLimit-count)                     
                    };
                    setTimeout(function(){
                        callBack && callBack({rt:r.rt,msg:r.msg,arg:arg});
                        $('#timeUpImg,.timeUpImg').removeClass('tada');
                        HdGame.resulePoup.show(arg);
                    },900);
                }else if(r.rt == 11){
					alert("已被检测到有作弊行为，再次被检测将永久禁止参与本游戏！");
				}else if(r.rt == 12){
					alert("由于作弊行为，该微信号已永久禁止参与本游戏！");
				}else{
                    //alert(r.msg);
                }
                if(r.rt !== 0){
                    callBack && callBack({rt:r.rt,msg:r.msg});
                }
            }
        });     
    }
    function changeTwoDecimal_f(x) {
        var f_x = parseFloat(x);
        if (isNaN(f_x)) {
            alert('function:changeTwoDecimal->parameter error');
            return false;
        }
        var f_x = Math.round(x * 100) / 100;
        var s_x = f_x.toString();
        var pos_decimal = s_x.indexOf('.');
        if (pos_decimal < 0) {
            pos_decimal = s_x.length;
            s_x += '.';
        }
        while (s_x.length <= pos_decimal + 2) {
            s_x += '0';
        }
        return s_x;
    }
    var drawStatus=true;
    function luckDraw(fn){
	    if(!drawStatus){
            return;
        }
        drawStatus=false;
        var r = Math.floor(Math.random()*10);
        $('.ajaxLoadBg').show();
        $('.ajaxLoadBar').addClass('ajaxLoad'); 
        var params = new Array();
        params.push("gameId=",10);
        params.push("&style=",15);
        params.push("&openId=","o1ueSjigVd4EIc_IballnhNEJfj0");
        
        params.push("&userName=","kylst");
        params.push('&isPub=',$.trim(''));
        params.push('&headImg=','http://wx.qlogo.cn/mmopen/aD34PShiaoar94D1IjiagE76McesibrtN5MhFEJ1XnRnw3Av2ywtuJPaYia5a0lx8nmKvjyiaKGCTzwNPQSxGRUQ6rcCic1FtbwKK7/0');
        params.push("&drawTimesLimit=",1);
        $.ajax({
            type : 'post',
            url : '//hd.faisco.cn/ajax/hdgame_h.jsp?cmd=getResult&aid=7167268',
            data : params.join(''),
            error : function(){ 
                //alert( '服务繁忙，请稍候重试' );
                HdGame.otherAjaxComplete();
                drawStatus=true;
                count++;
            },
            success : function(data){
                HdGame.tlog(data);
                HdGame.otherAjaxComplete(); 
                drawStatus=true;
                //resultBox.html("");   
                var result = $.parseJSON(data);
                var arg={
                    isSuc:result.success,
                    giftStyle:result.awardStyle,
                    giftName:result.awardName,
                    giftCode:result.awardCode,
                };
                if(result.success){
                    count++;
                    $("#count").text(drawTimesLimit-count<0 ? 0:(drawTimesLimit-count));
                    fn(arg);
                }else{
                    if (result.rt === 1) {
                        HdGame.statusMsg(4);
                        count = drawTimesLimit;
                        return;
                    }else if( result.rt ===  -3 ){
                        HdGame.statusMsg("活动不存在。");
                        return;
                    }else if(result.rt === -2){
                        //alert("参数错误。");
                        return;
                    }else if(result.rt === -1){
                        //alert("系统错误，请刷新再试。");
                        return;
                    }else{  
                        count++;
                        fn(arg);
                    }                   
                }
            }
        });     
    }
    
</script>



    </div>



<script type="text/javascript">
	var _faiAjax = function(){
		//for regexp
		var r = /\?/;
		var _o = {
			type:"get",
			url:"",
			data:"",
			error:function(){},
			success:function(){}
		};
		var _sendRequest=function(o) {
			var xmlhttp = null;
			//init option code
			o.type = o.type || _o.type;
			o.url = o.url || _o.url;
			o.data = o.data || _o.data;
			o.error = o.error || _o.error;
			o.success = o.success || _o.success;
			if (window.XMLHttpRequest) {
				// code for IE7+, Firefox, Chrome, Opera, Safari
				xmlhttp=new XMLHttpRequest();
			}else{
				// code for IE6, IE5
				xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			//the instructions param takes the form of an eval statement
			if(o.type != "post") {
				o.url += ( this.r.test( o.url ) ? "&" : "?" ) + o.data;
				xmlhttp.open("GET", o.url, true);
					xmlhttp.onreadystatechange=function() {
					if (xmlhttp.readyState==4 && xmlhttp.status==200) {
						o.success( xmlhttp.responseText );
					}else if( o.error ){
						o.error();
					}
				}
				xmlhttp.send();
			} else {
				xmlhttp.open("POST", o.url, true);
				//Send the proper header information along with the request
				xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded; charset=UTF-8");
				xmlhttp.onreadystatechange=function() {
					if (xmlhttp.readyState==4 && xmlhttp.status==200) {
						o.success( xmlhttp.responseText );
					}else{
						o.error();
					}
				}
				xmlhttp.send(o.data);
			}
		}
		return {
			ajax:function(option){
				try {
					//′?′?μ÷ó?μ?′í?ó2?è??×3???window?￡·à?1oˉêy??è?
					_sendRequest(option);	
				}catch(e){
					//alert(e);
				}
			}
		};
	}();
	
	
	
	var _jsErrCahche = [];
	window.onerror = function(sMsg,sUrl,sLine,columnNumber,errorObj){
		if( sLine < 1 || typeof sMsg != 'string' || sMsg.length < 1 ){
			return;
		}
		
		var log = "Error:" + sMsg + ";Line:" + sLine + ";Url:" + sUrl;
		var alertLog = "Error:"+sMsg+"\n" + "Line:" + sLine + "\n" + "Url:" + sUrl + "\n";
		var encodeUrl = function (url){
			return typeof url === "undefined" ? "" : encodeURIComponent(url);
		};
		
		var ajax = true;
		var obj = { 'm' : sMsg, 'u' : sUrl, 'l' : sLine };
		for( var i = 0; i < _jsErrCahche.length; i ++ ){
			if( _jsErrCahche[i].m == obj.m && _jsErrCahche[i].u == obj.u && _jsErrCahche[i].l == obj.l  ){
				ajax = false;
				break;
			}
		}
		
		if( ajax ){
			_jsErrCahche.push( obj );
			_faiAjax.ajax({
				type	: "post",
				url		: "//hd.faisco.cn/ajax/logJsErr_h.jsp?cmd=jsErr",
				data	: 'msg='+ encodeUrl(log)
			});
		}
		if(false){
			alert( alertLog );
		}
        HdGame.tlog("错误信息：" , sMsg);
        HdGame.tlog("出错文件：" , sUrl);
        HdGame.tlog("出错行号：" , sLine);
        HdGame.tlog("出错列号：" , columnNumber);
        HdGame.tlog("错误详情：" , errorObj);
	};

	$.ajaxSettings.errorCall.push(function(callbackContext, status, error){
		
		//ajaxê§°ü￡?é?±¨log?￡μ?2??üμ÷ó? $.ajax?￡òò?a$.ajaxê§°üè?oóé?±¨log?ùμ÷ó?$.ajaxμ??°￡??á?ì3éoˉêy??è?￡??ùè?é?±¨logμ?ajaxó?ê§°üμ??°￡??í?á?ùé?±¨￡??à?-?·ò??±??ó??ˉàà?÷×ê?′?￡
		var faiAjax = top._faiAjax || Fai.top._faiAjax;
		if( faiAjax ){
			faiAjax.ajax({
				type	: "post",
				url		: "//hd.faisco.cn/ajax/logAjaxErr_h.jsp?cmd=ajaxErr&error="+error+"&status="+status,
				data	: 'msg=' + HdGame.encodeHtml('ajaxUrl='+HdGame.encodeUrl(callbackContext.url)+';refer='+HdGame.encodeUrl(top.location.href))
			});
		}
	});

</script>
</body></html>